package cn.com.haopy.dataes.es.web;

import cn.com.haopy.dataes.core.utils.ResponseUtil;

import cn.com.haopy.dataes.es.service.EsUserPatientServices;
import cn.com.haopy.dataes.es.vo.PatientVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/test/")
@Api(tags = "就诊人相关接口")
public class TestController {
    private final Log logger = LogFactory.getLog(TestController.class);

    @Autowired
    public EsUserPatientServices esUserPatientServices;


    @PostMapping("add")
    @ApiOperation(value = "保存就诊人")
    public Object add(@Valid @RequestBody PatientVo patientVo) {

        return ResponseUtil.ok();
    }

    @PostMapping("search")
    @ApiOperation(value = "搜索")
    public Object search(String search) {
        return ResponseUtil.ok(esUserPatientServices.queryListBySearchKey(search));
    }
}
